package com.miao.controller.front;

import com.miao.entity.Order;
import com.miao.service.OrderService;
import com.miao.service.impl.OrederServiceImpl;
import com.miao.util.BeanCopyUtil;
import com.miao.util.ExchangeUtil;
import com.miao.vo.OrderVo;
import com.miao.vo.ResultVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: 丰
 * @date: 2023/3/2 18:01
 */
@RestController
@RequestMapping("/front/order")
@Api(tags = "订单接口")
public class OrderController {
    @Autowired
    OrderService orderService;

    @GetMapping("/query/{orderNo}")
    @ApiOperation("通过订单号查询订单")
    public ResultVo<OrderVo> selectCommentAllByPartTimeId(@PathVariable("orderNo") Integer orderNo) {
        ResultVo resultVo=orderService.selectCommentAllByPartTimeId(orderNo);
        return resultVo;
    }

    @GetMapping("/query/addorder")
    @ApiModelProperty("增加订单")
    public ResultVo<OrderVo> addOreder(@PathVariable OrderVo orderVo) {
        Order order=new Order();
        ResultVo resultVo=orderService.addOrder(order);
        return resultVo;

    }

    @GetMapping("/query/delorder")
    @ApiModelProperty("删除订单")
    public ResultVo<OrderVo> delOrder(@PathVariable OrderVo orderVo) {
        ResultVo resultVo=orderService.delOrder(orderVo);
        return resultVo;
    }

    @GetMapping("/query/editorder")
    @ApiModelProperty("修改订单")
    public ResultVo<OrderVo> editOrder(@PathVariable Order order) {
        ResultVo resultVo=orderService.editOrder(order);
        return resultVo;
    }



}
